from celery.task import task
import time

@task
def iddle_worker(timesleep=20):
    run = True
    progress = 0

    while run:
	#
	# 
	#
	iddle_worker.update_state(state="PROGRESS", meta={"current": progress, "total": 100})
	
	progress = progress + 1
	if progress > 100:
	    run = False
	else:
	    time.sleep(timesleep)    

    raise Exception("ERROR", "Si, fallo") 

    iddle_worker.update_state(state="FAILED")
    return False
    
